package com.liukuan.netty.bio2;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by liukuan on 16/3/30.
 */
public class BioTimeServer {

	public static void main(String[] args) throws IOException {
		ServerSocket ss = new ServerSocket(5678);
		GetTimeThreadPoolHandler executePool = new GetTimeThreadPoolHandler(50, 10000);

		while (true) {
			try {
				Socket socket = ss.accept();
				executePool.execute(new GetTimeHandler(socket));
			} catch (Exception e) {
				e.printStackTrace();
				break;
			}
		}

		ss.close();
	}

}
